-
Notifications
You must be signed in to change notification settings - Fork 472
[aws_billing] Add new aws_billing
integration
#14318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🚀 Benchmarks reportTo see the full report comment with |
a8077d3
to
6651b5e
Compare
packages/aws_billing/manifest.yml
Outdated
- custom | ||
conditions: | ||
kibana: | ||
version: "^8.18.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it not meant to be supported on ^9.0.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the functionality we need is already available in version 8.18.0
(probably even in older versions), so unless there are significant bug fixes in the filebeat awss3
input or other stack features in general, there's no strong justification for bumping the version 🤔
we could change it to ^8.16.5 || ^9.0.0"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gpop63 do you want to support only 8.x, or also 9.x? If you want to support both, you need to add || ^9.0.0
.
Dashboards updated @agithomas @daniela-elastic |
rename pipeline update pipeline tests
...ng/data_stream/cur/_dev/test/pipeline/test-aws-billing-without-resource-id.log-expected.json
Show resolved
Hide resolved
...ng/data_stream/cur/_dev/test/pipeline/test-aws-billing-without-resource-id.log-expected.json
Show resolved
Hide resolved
packages/aws_billing/data_stream/cur/elasticsearch/ingest_pipeline/default.yml
Outdated
Show resolved
Hide resolved
packages/aws_billing/data_stream/cur/elasticsearch/ingest_pipeline/default.yml
Outdated
Show resolved
Hide resolved
fix duplicate dashboard file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new AWS Cost and Usage Report (CUR 2.0) integration that polls S3 for billing files and provides prebuilt Kibana dashboards to visualize aggregated cost data over different time ranges.
- Added validation exclusions for specific checks.
- Created a
manifest.yml
defining package metadata, input variables, and an AWS S3 policy template. - Added three Kibana dashboards: Last month, Last 3 months, and Last 6 months.
Reviewed Changes
Copilot reviewed 28 out of 32 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/aws_billing/validation.yml | Excludes SVR00002 and SVR00003 checks |
packages/aws_billing/manifest.yml | Defines package metadata, vars, and aws-s3 input |
packages/aws_billing/kibana/dashboard/aws_billing-fb79da15-4c4c-453f-9d3d-b792ce2482ff.json | Dashboard for Last 6 months |
packages/aws_billing/kibana/dashboard/aws_billing-fa467f8d-50d9-4cb0-ae88-94ef24e9941a.json | Dashboard for Last month |
packages/aws_billing/kibana/dashboard/aws_billing-a716ad8e-0f77-4592-b497-6c841447efd2.json | Dashboard for Last 3 months |
Comments suppressed due to low confidence (3)
packages/aws_billing/manifest.yml:105
- [nitpick] The GitHub repository reference looks incorrect; update it to the correct integration repo (e.g.,
elastic/obs-integration-team
).
github: elastic/obs-infraobs-integrations
packages/aws_billing/kibana/dashboard/aws_billing-fb79da15-4c4c-453f-9d3d-b792ce2482ff.json:343
- [nitpick] This panel has an empty title; consider adding a descriptive name to improve dashboard readability.
"title": "",
packages/aws_billing/kibana/dashboard/aws_billing-fb79da15-4c4c-453f-9d3d-b792ce2482ff.json:502
- [nitpick] The title "Table " is generic and includes a trailing space; rename it to a meaningful description and remove extra whitespace.
"title": "Table ",
packages/aws_billing/kibana/dashboard/aws_billing-a716ad8e-0f77-4592-b497-6c841447efd2.json
Outdated
Show resolved
Hide resolved
#### Required CUR Export Configuration | ||
|
||
When creating your CUR export, the following **configuration is required** for compatibility: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets mention about the need to selection the following options, explicitly
-
How to navigate to the Data Exports options. It is not covered anywhere.
-
The user must select the Standard data export option
-
The time granularity setting is not mentioned . (Hourly / Daily / Monthly). Can you test if all the above options are supported as part of this integration.?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to navigate to the Data Exports options. It is not covered anywhere.
You can follow AWS documentation for setup:
🔗 [Creating Cost and Usage Reports in AWS](https://docs.aws.amazon.com/cur/latest/userguide/cur-create.html)
The user must select the Standard data export option
### AWS Cost and Usage Report (CUR) Export
To use this integration, you must first create a **standard CUR 2.0 data export** in AWS. This will automatically create an S3 bucket if one does not already exist.
The time granularity setting is not mentioned . (Hourly / Daily / Monthly). Can you test if all the above options are supported as part of this integration.?
Data granularity does not matter for this integration, it's just the number of rows present in the report that will be affected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i choose a monthly granularity, would the file be generated on a daily basis or on a monthly basis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Report would be generated at the same frequency (mostly daily) it's just that higher granularity will have more rows in the report.
For example, if an EC2 instance runs continuously for 24 hours:
- With hourly granularity, the CUR will include 24 line items for that instance, one per hour.
- With daily granularity, it will include 1 aggregated line item for the entire day.
- With monthly granularity, it will have 1 aggregated line item for that same instance for the entire month (it can still change under specific conditions)
|
packages/aws_billing/data_stream/cur/elasticsearch/ingest_pipeline/default.yml
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gpop63 - Make sure the integration upgrade scenario is validated with transforms.
LGTM!
@elastic/integrations-triaging hello 👋 can I get a review please? Code owner approval is required from this team. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving to unblock, adding some questions and suggestions.
@@ -0,0 +1,96 @@ | |||
# AWS CUR 2.0 Billing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this package relate to the billing
data stream in the AWS package? https://github.com/elastic/integrations/tree/main/packages/aws/data_stream/billing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that one uses the Cost and Usage API this one uses Data Export CUR 2.0 reports, which provide much more granularity. CUR 2.0 provifdes detailed billing data that enables deeper and more precise cost analysis, whereas the Cost and Usage API offers more generalized estimates
packages/aws_billing/manifest.yml
Outdated
- custom | ||
conditions: | ||
kibana: | ||
version: "^8.18.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gpop63 do you want to support only 8.x, or also 9.x? If you want to support both, you need to add || ^9.0.0
.
@@ -0,0 +1,4 @@ | |||
errors: | |||
exclude_checks: | |||
- SVR00002 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't the dashboards of this package contain filters? See https://github.com/elastic/elastic-package/blob/main/docs/howto/update_major_package_spec.md#expected-filter-in-dashboard-.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use a transform in this integration, the documents that we display are from that transform not from the raw data stream index, that's why I didn't add a dataset filter.
💔 Build Failed
Failed CI StepsHistory
cc @gpop63 |
Package aws_billing - 0.1.0 containing this change is available at https://epr.elastic.co/package/aws_billing/0.1.0/ |
Summary
This PR introduces a new integration for ingesting AWS Cost and Usage Report (CUR) 2.0 data from S3 buckets. The integration uses S3 polling with a minimum 24-hour interval (default) to avoid duplicate ingestion, as AWS CUR files are cumulative and updated multiple times daily.
The integration includes an hourly ES transform that groups billing data by key dimensions (service, account, usage type, region, tags) and aggregates unblended costs. This transform deduplicates the raw CUR data by creating uniquely identifiable data points.
For future upgrades, the transform configuration will require bumping both the
fleet_transform_version
and thedest.index
. Themove_on_creation: true
setting is required as it ensures the destination index becomes the only member of the alias when created, automatically removing previous indices from the alias. This allows dashboards to continue displaying the data correctly.I tested an actual upgrade by adding a new field to the transform's group by, then bumping the
fleet_transform_version
anddest.index
. On upgrade, a new indexaws_billing.billing_latest-v2
was created and got theaws_billing.billing_latest
alias. The old indexaws_billing.billing_latest-v1
lost the alias. The dashboards kept working fine because they use the alias, not the specific index names.The integration uses defaults specific for the AWS CUR usecase:
bucket_list_interval
is set to 24h to avoid duplicate datacontent_type
defaults totext/csv
, the standard CUR formatfile_selectors
defaults to\.csv\.gz$
(this doesn't work as a default yet)Removed Configuration Options for
aws-s3
I removed some config options that I thought are not relevant or applicable to this integration.
expand_event_list_from_field
include_s3_metadata
max_number_of_messages
queue_url
sqs_max_receive_count
sqs_wait_time
visibility_timeout
Minor inconveniences
logs-*
for some reason, this doesn't affect the functionalityUnable to setfile_selectors
default value to\.csv\.gz$
Checklist
changelog.yml
file.Author's Checklist
How to test this PR locally
Related issues
Screenshots